Conversation
4f82f37 to
bcf9a32
Compare
|
Interesting: the careful tests fail in exactly the same way as the tests fail on the opaque pyobject build. Maybe a useful hint that there's some unsafety happening somewhere... |
It looks like all the tests on Python 3.12 and newer fail the As @davidhewitt pointed out when I chatted with him last Friday - it's worth checking to see if doing that introduces performance regressions. If it does, we need to make sure we set things up so a codspeed uses the free-threaded build so it's not testing this configuration at all. I need to run benchmarks locally to see what the performance impact is. We also need a benchmark for creating PyClass instances - there is a benchmark for type initialization but not for instance initialization as far as I can see. |
|
I opened #5816 with a benchmark for creating an instance of a PyClass. I also had to hack in abi3 support for the benchmark crate, see #5818. Running the I ran the benchmarks on my personal development machine so there's some noise in the results. I'm showing the best of four runs of this benchmark for each commit. I see similar results on 3.15a6. Very roughly, there's a 5% performance cost. That's on the bubble for being significant but probably is too steep to force extensions to pay that cost on the 3.12 stable ABI. I think I'll go ahead and adjust this PR to only use |
Towards fixing #5786.
This is done on top of #5753 because that PR is needed to make this work.
With some help from @davidhewitt, this almost works but subclassing seems to be broken.
I suspect using
Layoutto fill inLayoutAsBaseis incorrect here:pyo3/pyo3-macros-backend/src/pyclass.rs
Line 2833 in 5e317f0
But I'm not sure how to update the macros and the macro wrappers to get that to work correctly.
@Icxolu do you happen to have any insight about what's going wrong?
TODO:
PyModuldeDefin the FFI bindings.